package com.progark.sound.model;

public class ResultsModel {
	
	
	private Player player1, player2, firstPlace, secondPlace;

	
	public ResultsModel(Player one, Player two){
		player1 = one;
		player2 = two;
	}
	
	public int playerOneScore(){
		return player1.getScore();
	}
	
	public int playerTwoScore(){
		return player2.getScore();
	}
	
	public String playerOneName(){
		return player1.getName();
	}
	
	public String playerTwoName(){
		return player2.getName();
	}
	
	public void setPlaces(String winner){
		if (winner.equals("one")){
			firstPlace = player1;
			secondPlace = player2;
		}
		else if (winner.equals("two")){
			firstPlace = player2;
			secondPlace = player1;
		}
	}
	
	public Player [] getScoreTable(){  //Lager array med de to spillerne rangert.
		Player [] scoreTable = new Player[2];
		scoreTable [0] = firstPlace;
		scoreTable [1] = secondPlace;
		
		return scoreTable;
	}
	
	

}
